<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateListsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lists', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('bond_code')->unique();//债券代码
            $table->decimal('CURRENT_BOND_PRICE',19,4)->default(0);//转债现价
            $table->decimal('TRANSFER_PRICE',16,2)->default(0);//转股价格
            $table->decimal('TRANSFER_PREMIUM_RATIO',16,2)->default(0);//转股溢价率
            $table->decimal('ACTUAL_ISSUE_SCALE',19,2)->default(0);//发行规模
            $table->string('SECURITY_NAME_ABBR',10);//转债名称
            $table->timestamp('VALUE_DATE')->nullable();//转债申购时间
            $table->string('SECURITY_SHORT_NAME',10);//正股名称
            $table->bigInteger('CONVERT_STOCK_CODE');//正股代码
            $table->timestamp('LISTING_DATE')->nullable();//上市日期
            $table->string('pinyin',10);//转债名称首拼音
            $table->mediumText('options')->nullable();//其它数据
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lists');
    }
}
